<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创建虚拟 DOM 对象 - 原生 JS</title>
</head>
<body>
    <div id="root"></div>

    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>

    <!-- 这里不需要设置, type="text/babel" -->
    <script>    
        // 创建虚拟DOM对象
        // let vDOM = React.createElement(标签名, 属性, 子元素, 子元素);
        //单层结构
        // let vDOM = React.createElement('h1', null, 'hello React');
        //多层结构
        let vDOM = React.createElement('div', {title: 'xinwen', 'a': 100}, 
                React.createElement('h1', null, 'hello React 你好'),
                React.createElement('p', null, 'React 是一个非常优秀的前端框架')    
            )
        
        ReactDOM.render(vDOM, document.querySelector("#root"));


        ReactDOM.render(vDOM, document.querySelector('#root'));
    </script>
</body>
</html>